package com.ophiux.order;

import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
import com.ophiux.common.feign.annotation.EnableOphiuxFeignClients;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

/**
 * @desc:
 * @author: hhl
 * @date：2021/10/27 11:43
 */
@SpringBootApplication
@MapperScan("com.ophiux.order.mapper")
@EnableOphiuxFeignClients
public class OrderApplication {
	public static void main(String[] args) {
		ConfigurableApplicationContext context = SpringApplication.run(OrderApplication.class, args);
		Environment evn = context.getBean(Environment.class);
		NacosDiscoveryProperties nacosDiscoveryProperties = context.getBean(NacosDiscoveryProperties.class);
		System.out.println("http://"+nacosDiscoveryProperties.getIp()+":"+nacosDiscoveryProperties.getPort()+"/swagger-ui/index.html");
		System.out.println("订单服务启动成功,端口：" + evn.getProperty("server.port"));
	}
}
